<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import="java.util.ArrayList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><link rel="stylesheet" type="text/css" href="style.css">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Friends</title>
</head>
<%ArrayList<String> friendsList = (ArrayList)session.getAttribute("friendsList");%>
<body>
<%ArrayList<String> myProfile = (ArrayList)session.getAttribute("details");%>
<div id="header">
<ul>
<div><span style="float:right"><a href="Logout.jsp" ><b>Logout</b></a></div>
<form name="Search" action="Search.do" method="post" onsubmit="return validateForm();">
<th> Search people  : </th><th> <input name="search_user" size=50 type="text" /> </th>
<input type="submit" name="submit" class="classname2" value="Search"></form>
<script>
function validateForm()
{
var x=document.forms["Search"]["search_user"].value;
if (x==null || x=="")
  {
  return false;
  }
}
</script>
</ul>
</div>


<div id="navigation">
<ul>
<img src="<%=myProfile.get(6)%>" width="100" height="100"><br>
<a href="Profile.jsp"  ><b>View My Profile</b></a>
<br><form action="ChatWindow.do" method="post"><input type="submit" class="classname" name="submit" value="Chat Room	     "></form>
<form action="FriendsList.do" method="post">
<th> <input name="submit" size=50 type="submit" class="classname" value="Friends		     "/> </th></form>
<form action="PendingRequests.do" method="post">
<th> <input name="submit" size=40 type="submit" class="classname" value="Friend Requests"/> </th></form>
</ul>
</div>

<div id="content">
<ul>
<%if(friendsList!= null){%>
	You have <%=friendsList.size()%> friends.<br>
	<%for (int i=0; i< friendsList.size();i++){%>
	<div ul><span style="float"><a href="PeopleProfile.do?emailaddress=<%=friendsList.get(i)%>&friends=Remove from friends" ><b><%=friendsList.get(i)%></b></a></div>
	<%} }else {%>
	It's lonely here.<%} %>
<%session.setAttribute("login","true");
%>
</ul>
</div>
</body>
</html>